package net.koodar.forge.log.event;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.koodar.forge.common.handler.Handler;
import net.koodar.forge.common.handler.IHandler;
import net.koodar.forge.log.service.EventOperateLogService;

/**
 * @author liyc
 */
@Slf4j
@Handler
@RequiredArgsConstructor
public class OperateLogEventHandler implements IHandler<OperateLogEvent> {

	private final EventOperateLogService operateLogService;

	@Override
	public void handler(OperateLogEvent event) {
		log.debug("调用异步方法保存操作日志:{}", Thread.currentThread().getId());
		operateLogService.add(event);
	}
}
